export default function formatDuring(date) {
    //时区转换有问题，此举为临时操作
    let millisecond = new Date().getTime() - date-8*1000 * 60 * 60
    let years = Math.floor(millisecond / (1000 * 60 * 60 * 24 * 30 * 12))
    let months = Math.floor(millisecond / (1000 * 60 * 60 * 24 * 30)) - Math.floor(millisecond / (1000 * 60 * 60 * 24 * 30 * 12)) * 12
    let days = Math.floor(millisecond / (1000 * 60 * 60 * 24)) - Math.floor(millisecond / (1000 * 60 * 60 * 24 * 30)) * 30
    let hours = Math.floor(millisecond / (1000 * 60 * 60)) - Math.floor(millisecond / (1000 * 60 * 60 * 24)) * 24
    let minutes = Math.floor(millisecond / (1000 * 60)) - Math.floor(millisecond / (1000 * 60 * 60)) * 60
    if (years > 0)
    return years + '年前'
    else if (months > 0)
    return months + '个月前'
    else if (days > 0)
    return days + '天前'
    else if (hours > 0)
    return hours + '小时前'
    else if (minutes > 0)
    return minutes + '分钟前'
    else
    return '刚刚'
}